<!DOCTYPE HTML>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
	<title>秒杀产品列表</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../../css/app.css" />
	<style type="text/css">
		body {
			background-color: #F0F1F2
		}

		.aui-bar-tab {
			position: relative;
			table-layout: auto;

			color: #690078;
			/*box-shadow: 0 0 1rem #e6e6e6;*/
		}

		.aui-bar-tab .aui-bar-tab-item {
			background-color: #f1faff;
			height: 2.75rem;
			color: #000;
		}

		.aui-bar-tab-item.active {
			/*background-color: #690078;*/
			/* background: linear-gradient(135deg, rgba(132, 229, 255, 1) 0%, rgba(107, 180, 255, 1) 100%, rgba(122, 174, 229, 1) 100%); */
		}

		.aui-bar-tab-item.active>div {
			color: #FFFFFF!important;
		}

		.aui-bar-tab-item.active:after {
			content: '';
			bottom: -9px;
			position: absolute;
			border-left: 10px solid transparent;
			border-right: 10px solid transparent;
			/* border-top: 10px solid rgba(85, 200, 255); */
			margin-left: -10px;
		}

		.aui-bar-tab-item.actives .aui-font-size-13,
		.aui-bar-tab-item.active_future .aui-font-size-13 {
			/*background-color: #FCE5FF;*/
			color: rgba(153, 153, 153, 1);
		}
		/*.aui-bar-tab-item.actives:after {
				content: '';
				bottom: -9px;
				position: absolute;
				border-left: 10px solid transparent;
				border-right: 10px solid transparent;
				border-top: 10px solid #FCE5FF;
				margin-left: -10px;
			}*/

		.tag-time {
			display: inline-block;
			/*background-color: #FF3862;*/
			color: #FF6642;
			height: 1rem;
			width: 1rem;
			line-height: 1rem;
			font-size: 0.85rem;
			border-radius: .15rem;
		}

		.ming-active-goods-list {
			padding: 0 0.75rem;
		}

		.ming-active-goods-list-item {
			/*padding: 1rem 0;*/
			/*padding-top: .75rem;*/
			display: flex;
			flex-direction: row;
		}

		.ming-active-goods-list-item:first-child {
			padding-top: 0;
		}

		.ming-active-goods-list-item-img img {
			width: 4.3rem;
		}

		.ming-active-goods-list-item-right {
			padding-left: 0.75rem;
			display: flex;
			flex: 1;
			flex-direction: column;
			justify-content: space-between;
		}

		.aui-progress.sm,
		.aui-progress-sm,
		.aui-progress.sm .aui-progress-bar,
		.aui-progress-sm .aui-progress-bar {
			border-radius: 0.5rem;
		}

		.aui-progress-sm {

			background-color: #FFFFFF;
			border: 1px solid #FF3862;
			margin: 0.2rem 0;
		}

		.aui-progress-bar {
			background-color: #FF3862;
		}

		.tag-tuangou {
			display: inline-block;
			font-size: 0.8rem;
			color: #FFFFFF;
			background-color: #FF3862;
			height: 1.4rem;
			line-height: 1.4rem;
			padding: 0 1.1rem;
			border-radius: 1.4rem;
			box-shadow: 0 5px 10px RGBA(255, 210, 210, 0.7);
		}

		.ms-head {
			background: linear-gradient(135deg, rgba(132, 229, 255, 0.9) 0%, rgba(107, 180, 255, 0.9) 100%, rgba(122, 174, 229, 0.9) 100%);
		}

		.ms-time {
			font-size: 1rem;
			font-family: Akrobat-Bold;
			font-weight: bold;
			color: rgba(51, 51, 51, 1);
		}

		.ms-status {
			font-size: .6rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(153, 153, 153, 1);
		}

		.seckill_header {
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 1.05rem 0 0.55rem 0;

		}

		.seckill_header_time {
			display: flex;
			width: 3.6rem;
			font-size: 0.9rem;
			font-family: Akrobat-Bold;
			font-weight: bold;
			color: #F73024;
			line-height: 1rem;


		}

		.left_line {
			width: 3.65rem;
			height: 1px;
			background: rgba(198, 198, 198, 0.5);
			margin-right: 0.6rem;
		}

		.right_line {
			width: 3.65rem;
			height: 1px;
			background: rgba(198, 198, 198, 0.5);
			margin-left: 0.4rem;
		}

		.seckill_detail {
		    background:#fff;
			padding:0.5rem;
			width:100%;
			box-sizing: border-box;
			border-radius: 0.4rem;
			float: left;

		}

		.seckill_detail .left_img {
			margin-right: 0.75rem;
			width:5rem;float: left;
		}

		.seckill_detail .left_img img {
			width:5rem !important;
			height:5rem !important;
			border-radius: 0.2rem;
		}
		.right_cont{width:100%;}

		.right_cont_title {
			height:2.1rem;
			font-size: 0.8rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(34, 34, 34, 1);
			line-height: 1.1rem;
			overflow: hidden;


		}

		.sale_count {

			height: 0.7rem;
			background: rgba(246, 246, 246, 1);
			border-radius: 0.35rem;
			font-size: 0.5rem;
			font-family: PingFangSC-Medium;
			font-weight: 500;
			color: rgba(153, 153, 153, 1);
			line-height: 0.7rem;
			padding-left: 0.5rem;
			margin-bottom: 0.7rem;
			padding-top: 1px;
		}

		.seckill_btn {
			display: flex;
			justify-content: space-between;

		}

		.buy_immediately {
			width: 3.6rem;
			height: 2.4rem;
			background:linear-gradient(270deg,rgba(252,125,74,1) 0%,rgba(247,48,36,1) 100%);
			border-radius: 0.2rem;
			text-align: center;
			font-size: 0.65rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(255, 255, 255, 1);
			margin-top:0.42rem
		}

		.buy_immediately_end {
			width: 3.6rem;
			height: 2.4rem;
			background:linear-gradient(270deg,rgba(214,214,214,1) 0%,rgba(167,167,167,1) 100%);
			border-radius: 0.2rem;
			text-align: center;
			font-size: 0.65rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: rgba(255, 255, 255, 1);
		    margin-top:0.42rem
		}

		.picture-list {
			overflow: hidden;
			margin-left: 2rem;

		}

		.is_img_padding {
			padding-bottom: 0.75rem;
		}

		.picture-list .li {
			float: left;
			width: calc(33.33% - 0.14rem);
			margin-right: 0.2rem;
			margin-bottom: 0.06rem;
			height: 4.95rem;
		}

		.picture-list .li:nth-child(3n) {
			margin-right: 0;
		}

		.picture-list .li img {
			width: 100%;
			height: 100%;
			border-radius: 0.2rem;
		}

		.border_image {
			/* border-image: -webkit-linear-gradient(135deg, rgba(132, 229, 255, 1), rgba(107, 180, 255, 1), rgba(122, 174, 229, 1)) 0.05 0.05;
			border-image: -moz-linear-gradient(135deg, rgba(132, 229, 255, 1), rgba(107, 180, 255, 1), rgba(122, 174, 229, 1)) 0.05 0.05;
			border-image: -o-linear-linear-gradient(135deg, rgba(132, 229, 255, 1), rgba(107, 180, 255, 1), rgba(122, 174, 229, 1)) 0.05 0.05;
			border-image: linear-gradient(135deg, rgba(132, 229, 255, 1), rgba(107, 180, 255, 1), rgba(122, 174, 229, 1)) 0.05 0.05; */

		}

		.skill_head_wraper {
			background: #FAFAFA;
			padding: 0.35rem 0;
			text-align: center;
			color:#2e2e2e
		}

		.active_skill {
			/* background: linear-gradient(135deg, rgba(132, 229, 255, 1) 0%, rgba(107, 180, 255, 1) 100%, rgba(122, 174, 229, 1) 100%); */
			color:#F73024

		}

		.active_skill_title {
			color:#F73024 !important
		}

		.active_skill_status {
			color: rgba(255, 255, 255, 1) ;
		}

		.over_style {
			/* margin-top: 0.75rem; */
		}

		.arrow {
			margin-left: 10px;
			float: left;
			width: 0;
			height: 0;
			border-width: 0.25rem;
			border-style: solid;
			border-color: #6BB4FF transparent transparent transparent;
		}

		.border-right-active {
			/* border-right: 1px solid rgba(114, 193, 255, 0.2); */
		}
		/*进度条*/

		.aui-progress.sm,
		.aui-progress-sm,
		.aui-progress.sm .aui-progress-bar,
		.aui-progress-sm .aui-progress-bar {
			border-radius: 0.5rem;
		}

		.aui-progress-sm {
			background-color: #FFFFFF;
			/*margin: 0.2rem 0;*/
		}

		.aui-progress-bar {
			/*background-color: #FF3862;*/
			/* background: linear-gradient(135deg, rgba(227, 234, 86, 1) 0%, rgba(162, 225, 58, 1) 100%, rgba(122, 174, 229, 1) 100%); */
			background:#fff
		}
		.killWrapper{padding-left:0.75rem;padding-right:0.75rem;margin-top:1rem;}
		.top_title {
		  height:2.4rem; overflow: hidden; text-overflow: ellipsis; white-space: normal;
		}

		.top_title span {
			font-size: 0.8rem;
			font-family: PingFangSC-Regular;
			font-weight: 400;
			color: #222222;
			line-height: 1.1rem;
			/*display: inline-block;*/
		}
		.status_bg{background:linear-gradient(270deg,rgba(252,125,74,1) 0%,rgba(247,48,36,1) 100%);border-radius:0.5rem;color:#fff;padding:0 0.2rem;height:0.85rem;display: inline-block;margin-left:0;left:0.6rem;position: absolute;top:1.6rem;font-size:0.55rem; text-align: center;line-height: 0.9rem;}
	    .status_bg.over{background:linear-gradient(270deg,rgba(214,214,214,1) 0%,rgba(167,167,167,1) 100%);}
		.status_bg.start{margin-left:0.6rem}
		.status_bg.debouchment{margin-left:0.8rem}
		.bgColor{background:#FFE6E6;width:1rem;height:1rem; text-align: center;line-height: 1rem;}
		/* .wrapper{padding-left:0.75rem;padding-right:0.75rem;background-color: #F0F1F2;float: left;margin-top:2rem} */
	</style>
</head>

<body>
	<div id="app" class="aui-content" v-cloak="">
		<!-- v-if="info.length>=1" -->
		<div class="ming-bg-white">

			<!-- 秒杀状态头部栏 -->
			<!-- <div class="aui-bar aui-bar-tab ms-head">
				<div v-for="(vo,index) in miaoTime" class="aui-bar-tab-item" :class="{'active':tab_index==index,'actives':vo.status=='已结束','active_future':vo.status=='即将开始'}" tapmode @click="tapindex(index,vo.id)">
					<div class="ms-time" style="border:1px solid red;">
						{{vo.title}}
					</div>
					<div class="ms-status">
						{{vo.status}}
					</div>
				</div>
			</div> -->
			<div style="display:flex;justify-content:space-between; position: relative;">
				<div v-for="(vo,index) in miaoTime" style="width:25%;height:100%;position:relative" tapmode @click="tapindex(index,vo.id)">
					<div class="skill_head_wraper"  :class="{'active_skill':tab_index==index}">
						<div :class="{'border-right-active':tab_index!=index}" >
							<div :class="{'active_skill_title':tab_index==index}" style="font-size:1rem;font-family:Akrobat-Bold ;color:rgba(51,51,51,1);line-height:1.25rem;">
								{{vo.title}}
							</div>
							<div :class="{'active_skill_status':tab_index==index}"  style="font-size:0.6rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(153,153,153,1);line-height:0.85rem;">

								{{vo.status}}
							</div>
						</div>
					</div>
					<div v-if="miaoTime[tab_index].status=='进行中' && tab_index==index" class="status_bg debouchment" >进行中</div>
					<div v-if="miaoTime[tab_index].status=='即将开始' && tab_index==index" class="status_bg start" >即将开始</div>
					<div v-if="miaoTime[tab_index].status=='已结束' && tab_index==index" class="status_bg over debouchment" >已结束</div>
					<!-- 底部三角形 -->
					<div class="arrow" style="position:absolute;left:calc(50% - 0.75rem);top:-8rem" v-if="tab_index==index">

					</div>
				</div>

			</div>



			<div class="ming-card-list-header " style="padding-left:0.75rem;padding-right:0.75rem;background:#F0F1F2;">
				<div v-if="" >
					<div>
						<!-- 显示当前秒杀状态的实时时间 -->
						<div>
							<div v-if="miaoTime[tab_index].status!='已结束'&&info.length>=1" class="seckill_header" >

								<div v-if="miaoTime[tab_index].status=='进行中'" style="font-size:0.7rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(51,51,51,1);margin-right:0.2rem;color:#2E2E2E">距结束</div>
								<div v-if="miaoTime[tab_index].status=='即将开始'"  style="font-size:0.7rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(51,51,51,1);margin-right:0.2rem;color:#2E2E2E">即将开始</div>

								<div class="seckill_header_time">
									<div class="bgColor">{{settime('h',now_time,miaoTime[tab_index])}}</div>
									<div>:</div>
									<div class="bgColor">{{settime('m',now_time,miaoTime[tab_index])}}</div>
									<div>:</div>
									<div class="bgColor">{{settime('s',now_time,miaoTime[tab_index])}}</div>
								</div>

							</div>
							<!-- <div style="background-color: #F0F1F2; line-height: 2rem;font-size:0.7rem; text-align: center;">距结束 <span style="color:#F73024;font-size:0.7rem">03:24:24</span></div> -->



							<div v-if="info" v-for="vo in info" :class="{'over_style':miaoTime[tab_index].status=='已结束'&&info.length<=1}" >
								<div class="seckill_detail" style="float: left;margin-top:0.6rem">
									<div class="left_img">
										<img :src="vo.cover" alt="">
									</div>
									<div class="right_cont col-xs-x">

											<div tapmode @click="opennext(vo.good_id,vo.miao_id,miaoTime[tab_index].status,miaoTime[tab_index].miao_start_time)" class="right_cont_title">
												{{vo.title}}


										</div>
										<!-- <div v-else class="aui-progress aui-progress-sm" style="width: 7.1rem;height: 0.7rem;background: rgba(246, 246, 246, 1);border-radius: 0.35rem;font-size: 0.5rem;font-family: PingFangSC-Medium;font-weight: 500;color: rgba(153, 153, 153, 1);position:relative;border:none;">
											<div class="aui-progress-bar" :style="{width: vo.sold_per+'%'}" ></div>
											<div style="font-size:0.5rem;font-family:PingFangSC-Medium;font-weight:500;color:rgba(153,153,153,1);;position:absolute;left:0.5rem;line-height:0.7rem;">
												已售{{vo.sold_num}}件
											</div>
										</div> -->

										<!-- <div class="sale_count">
											已售{{vo.sold_num}}件
										</div> -->




										<div class="seckill_btn" v-if="">
											<div style="display:block;width:100%;">
												<span style="font-size: .7rem;color:#E90000;">￥<span style="font-size:1.1rem;color:#E90000;">{{price_format('yuan',vo.miao_price)}}.<span style="font-size:1.1rem;color:#E90000;display:inline-block:margin-right:0.2rem;">{{price_format('fen',vo.miao_price)}}</span></span>
												</span>
												<div style="display:block;width:100%;"><del style="color:rgba(153,153,153,.7);font-size: .65rem;font-weight:400;">￥{{vo.current_price}}</del></div>



											</div>


											<!-- <div class="buy_immediately">
												立即抢购
											</div> -->
											<div v-if="miaoTime[tab_index].status=='即将开始'&&!is_remind(vo.miao_id,vo.good_id)" class="buy_immediately" tapmode @click="add_remind(vo.miao_id,vo.good_id)" style="	background:linear-gradient(270deg,rgba(97,191,197,1) 0%,rgba(1,149,149,1) 100%);padding:0 0.3rem;height:1.3rem;margin-top:1.5rem;width:4.6rem">
												<span style="display: inline-block;padding-top:0.2rem">提醒我</span>

											</div>
											<div v-if="miaoTime[tab_index].status=='即将开始'&&is_remind(vo.miao_id,vo.good_id)" class="buy_immediately border_image" style="color:rgba(114,213,239,1);background: #FFFFFF;background:linear-gradient(270deg,rgba(97,191,197,0.4) 0%,rgba(1,149,149,0.4) 100%);width:4.6rem;color:#018D8D;padding:0 0.3rem;height:1.3rem;margin-top:1.5rem" tapmode @click="remove_remind(vo.miao_id,vo.good_id)">
												<span style="display: inline-block;padding-top:0.2rem">取消提醒</span>

											</div>
											<div v-if="miaoTime[tab_index].status=='进行中'&&vo.sold_per<100" class="buy_immediately" tapmode @click="openWin_goods_detail(vo.good_id)" >
												<span style="display: inline-block;padding-top:0.2rem;">立即抢购</span>
												<div  class="aui-progress aui-progress-sm" style="width: 88%;margin:0 auto;height: 0.15rem;background: rgba(255, 255, 255, 0.6);border-radius: 0.35rem;font-size: 0.5rem;font-family: PingFangSC-Medium;font-weight: 500;color: rgba(153, 153, 153, 1);position:relative;border:none;margin-top:0.05rem">
													<div class="aui-progress-bar" :style="{width: vo.sold_per+'%'}"></div>

												</div>
												<div style="font-size:0.5rem;font-family:PingFangSC-Medium;font-weight:500;color:rgba(153,153,153,1);left:0.5rem;line-height:0.7rem;color:#fff;margin-top:0.18rem">
													已售{{vo.sold_num}}件
												</div>
												<!-- <div v-else class="aui-progress aui-progress-sm" style="width: 7.1rem;height: 0.7rem;background: rgba(246, 246, 246, 1);border-radius: 0.35rem;font-size: 0.5rem;font-family: PingFangSC-Medium;font-weight: 500;color: rgba(153, 153, 153, 1);position:relative;border:none;">
													<div class="aui-progress-bar" :style="{width: vo.sold_per+'%'}" ></div>
													<div style="font-size:0.5rem;font-family:PingFangSC-Medium;font-weight:500;color:rgba(153,153,153,1);;position:absolute;left:0.5rem;line-height:0.7rem;">
														已售{{vo.sold_num}}件
													</div>
												</div> -->
											</div>
											<div v-if="miaoTime[tab_index].status=='进行中'&&vo.sold_per==100" class="buy_immediately" tapmode @click="openWin_goods_detail(vo.good_id)" style="background:linear-gradient(270deg,rgba(214,214,214,1) 0%,rgba(167,167,167,1) 100%);">
												<span style="display: inline-block;padding-top:0.2rem">已售罄</span>
												<div  class="aui-progress aui-progress-sm" style="width: 88%;margin:0 auto;height: 0.15rem;background: rgba(255, 255, 255, 0.6);border-radius: 0.35rem;font-size: 0.5rem;font-family: PingFangSC-Medium;font-weight: 500;color: rgba(153, 153, 153, 1);position:relative;border:none;margin-top:0.05rem">
													<div class="aui-progress-bar" :style="{width: vo.sold_per+'%'}" ></div>

												</div>
												<div style="font-size:0.5rem;font-family:PingFangSC-Medium;font-weight:500;color:rgba(153,153,153,1);left:0.5rem;line-height:0.7rem;color:#fff;margin-top:0.18rem">
													已售{{vo.sold_num}}件
												</div>
											</div>
											<div tapmode @click="openWin_goods_detail(vo.good_id)" v-if="miaoTime[tab_index].status=='已结束'" class="buy_immediately" style="	background:linear-gradient(270deg,rgba(252,125,74,0.6) 0%,rgba(247,48,36,0.9) 100%);">
												<span style="display: inline-block;padding-top:0.2rem">已结束</span>
												<div  class="aui-progress aui-progress-sm" style="width: 88%;margin:0 auto;height: 0.15rem;background: rgba(255, 255, 255, 0.6);border-radius: 0.35rem;font-size: 0.5rem;font-family: PingFangSC-Medium;font-weight: 500;color: rgba(153, 153, 153, 1);position:relative;border:none;margin-top:0.05rem">
													<div class="aui-progress-bar" :style="{width: vo.sold_per+'%'}"></div>

												</div>
												<div style="font-size:0.5rem;font-family:PingFangSC-Medium;font-weight:500;color:rgba(153,153,153,1);left:0.5rem;line-height:0.7rem;color:#fff;margin-top:0.18rem">
													已售{{vo.sold_num}}件
												</div>
											</div>



										</div>
									</div>
								</div>
							</div>

							<!-- <div v-if="info.good_list.length<1" style="text-align:center;">
									<img src="../image/bg/bg-nomessage.png" style="width:5.5rem;height:5rem;margin:0 auto;margin-top:6rem;margin-bottom:0.5rem;" />
									<div style="font-size:0.75rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(34,34,34,1);">
										暂无活动
									</div>
								</div> -->
						</div>
					</div>
				</div>

			</div>

			<!-- 秒杀商品栏 -->

		</div>

		<div v-if="info.length<1" class="aui-text-center" style="margin-top: 40%;">
			<img src="../../image/bg/bg-nonedan.png" style="width:7.55rem;margin-left:50%;transform:translateX(-50%);margin-bottom:1rem" />
			<div class="aui-font-size-16 ming-text-hui6 aui-margin-t-10" style="font-size:.75rem;font-family:PingFangSC-Regular;font-weight:400;color:#B3B3B3 !important">
				暂无秒杀产品
			</div>
			<div class="aui-text-center" tapmode onclick="openWin_goods_list_type('all')">
				<div class="aui-btn" style="display:inline-block;margin-top: 1.5rem;width:10rem;border-radius:0.3rem;height:2.3rem;line-height:2.3rem;text-align:center;background:#005A93;color:#fff;font-size:.8rem;font-family:PingFangSC-Regular;font-weight:400;">
					去逛逛
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">

//    var miaoTimes=[
// 	   {
// 		   status:"即将开始"
// 	   },
// 	   {
// 		   status:"已结束"
// 	   },
// 	   {
// 		   status:"进行中"
// 	   }
//    ]

	var vm = new Vue({
		el: '#app',
		data: {
			tab_index: 0,
			miaoTime: [],
			info: [],
			time_id: 0,
			id: 0,
			remind_list: [], //[{act_id:2,goods_id:1}]提醒列表
			next_countdown: 0, //下一场倒计时
			now_time: Date.parse(new Date()) / 1000,
			remind: [],
			localcity:{"id":2608,"parentid":235,"categoryname":"平邑县","spell":"pingyixian","first_letter":"P"}
		},

		methods: {
			get_date_list: function() {
				get_data('api/Miao/getMiaoTime', {}, function(ret) {
					// alert(JSON.stringify(ret,null,2))
					if (ret.status) {
						vm.miaoTime = ret.data
						var have_active = false;
						ret.data.forEach(function(el, index) {
							if (el.status == '进行中') {
								tapindex(index, el.id)
								have_active = true
							}
						})
						if (!have_active) {
							vm.time_id = vm.miaoTime[0].id
							vm.get_list()
						}
					}
				})
			},
			get_list: function() {
				get_data('api/Miao/miaoGoodList', {
					time_id: vm.time_id,
					region_name:vm.localcity.categoryname
				}, function(ret) {
					// alert(JSON.stringify(ret))
					if (ret.status) {
						vm.info = ret.data
					}
				})
			},
			price_format: function(type, price) {
				var price = (price).toFixed(2);
				var status = (price + '').indexOf('.')
				if (status == '-1') {
					if (type == 'yuan') {
						return price;
					}
					if (type == 'fen') {
						return '00';
					}
				}
				var price_array = (price + '').split('.')
				if (type == 'yuan') {
					return price_array[0];
				}
				if (type == 'fen') {
					var price_fen = price_array[1].length < 2 ? price_array[1] + '0' : price_array[1];
					return price_fen;
				}
			},
			is_remind: function(act_id, good_id) {
				var status = false;
				vm.remind.forEach(function(el) {
					if (el.miao_id == act_id && el.good_id == good_id) {
						status = true
					}
				})
				return status;
			},
			add_remind: function(act_id, good_id) {
				var data = vm.remind;
				var newdata = {
					miao_id: act_id,
					good_id: good_id,
					time: vm.miaoTime[vm.tab_index].miao_start_time
				}
				data.push(newdata)
				vm.remind = data
				$api.setStorage('remind', data)
					// alert(JSON.stringify($api.getStorage('remind')))
					//					发送事件给首页
				toast('设置成功，将在开抢时提醒您')
			},
			remove_remind: function(act_id, good_id) {
				var data = vm.remind;
				var newdata = []
				data.forEach(function(el, index) {
					if (el.miao_id == act_id && el.good_id == good_id) {

					} else {
						newdata.push(el)
					}
				})
				vm.remind = newdata
				$api.setStorage('remind', newdata)
					//					发送事件给首页
				send_event('remind_add')
				toast('已取消秒杀提醒~')
			},
			settime: function(type, nowtime, el) {
				var data;
				if (el.status == "即将开始") {
					data = TimeCountDowns(el.miao_start_time, nowtime);
				}
				if (el.status == "进行中") {
					data = TimeCountDowns(el.miao_end_time, nowtime);
				}
				if (data != '0') {
					if (type == 'h') {
						return data.hours
					}
					if (type == 'm') {
						return data.minutes
					}
					if (type == 's') {
						return data.seconds
					}
				} else {
					return '00';
				}
			}
		}
	})
	apiready = function() {

		var temp_localcity = api.getPrefs({
				sync: true,
				key: 'localcity'
		});

		if (temp_localcity) {
				vm.localcity = JSON.parse(temp_localcity);
		}

		api.addEventListener({
				name: 'jobRefresh'
		}, function(ret, err) {
				localcity(function(ret) {
						if (ret) {
								vm.localcity = ret;
						  	vm.get_list()
						}
				})
		});

		vm.get_date_list()
			fnInitPullRefresh(function() {
					vm.get_list()
				})
			// 新版刷新
		refresh_new(function() {
			setTimeout(function() {
				vm.get_list()
				api.refreshHeaderLoadDone()
			}, 1000)
		})
		setInterval(function() {
			vm.now_time = Date.parse(new Date()) / 1000
		}, 200)
		if ($api.getStorage('remind')) {
			vm.remind = $api.getStorage('remind');
		}
		add_event('remind_add', function() {
			if ($api.getStorage('remind')) {
				vm.remind = $api.getStorage('remind')
			} else {
				vm.remind = []

			}
		})

	};

	function tapindex(index, id) {
		vm.tab_index = index
		vm.time_id = id;
		vm.get_list()
	}




	function opennext(good_id, miao_id, status,soon_time) {
		var is_remind_new = '秒杀即将开始'
		if (status == '即将开始') {
			openWin_goods_detail(good_id, miao_id, vm.time_id, is_remind_new,soon_time)
		} else {
			openWin_goods_detail(good_id)
		}
	}
	//
	// function computed_remind() {
	// 	var data = $api.getStorage('remind')
	// }
</script>

</html>
